package com.zfei.gfb.bean;

import com.google.common.collect.Lists;
import com.zfei.gfb.api.domain.TalkEvent;
import com.zfei.gfb.model.GfbGreenPlot;
import com.zfei.gfb.model.GfbHouse;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;
import java.util.Map;

@ApiModel
public class HouseResult {

    public HouseResult() {
        this.events = Lists.newArrayList();
    }

    public HouseResult(List<TalkEvent> events, List<GfbHouse> houses) {
        this.events = events;
        this.houses = houses;
    }

    public HouseResult(List<TalkEvent> events) {
        this.events = events;
    }

    @ApiModelProperty("事件列表")
    private List<TalkEvent> events;
    @ApiModelProperty("房源列表")
    private List<GfbHouse> houses;
    @ApiModelProperty("菜地列表")
    private List<GfbGreenPlot> greenPlots;

    @ApiModelProperty("按日期分组事件")
    private Map<String, List<String>> dateMap;


    public List<TalkEvent> getEvents() {
        return events;
    }

    public void setEvents(List<TalkEvent> events) {
        this.events = events;
    }

    public List<GfbHouse> getHouses() {
        return houses;
    }

    public void setHouses(List<GfbHouse> houses) {
        this.houses = houses;
    }

    public List<GfbGreenPlot> getGreenPlots() {
        return greenPlots;
    }

    public void setGreenPlots(List<GfbGreenPlot> greenPlots) {
        this.greenPlots = greenPlots;
    }

    public static HouseResult buildHouse(List<TalkEvent> events, List<GfbHouse> houses) {
        return new HouseResult(events, houses);
    }

    public static HouseResult build(List<TalkEvent> events, List<GfbGreenPlot> greenPlots) {
        HouseResult result = new HouseResult(events);
        result.setGreenPlots(greenPlots);
        return result;
    }

    public static HouseResult empty() {
        return new HouseResult();
    }

    public void setDateMap(Map<String, List<String>> exhibitionPitemMap) {
        this.dateMap = exhibitionPitemMap;
    }

    public Map<String, List<String>> getDateMap() {
        return dateMap;
    }
}
